﻿@model SubmitReturnRequestModel
@using Nop.Web.Models.Order;
@{
    Layout = "~/Views/Shared/_ColumnsOne.cshtml";

    //title
    Html.AddTitleParts(T("PageTitle.ReturnItems").Text);
}
<div class="container">
    <div class="features_items my-account-page"><!--features_items-->
        <h2 class="title text-center">@string.Format(T("ReturnRequests.Title").Text, Model.OrderId)</h2>
        <div class="custom-page-box-div">
            @if (!String.IsNullOrEmpty(Model.Result))
                    {
                        <div class="result">
                            @Model.Result
                        </div>
                    }
                    else
            {
                using (Html.BeginForm())
                {
                     @Html.AntiForgeryToken()
                    <div class="section">
                        <div class="title">
                            <strong>@T("ReturnRequests.SelectProduct(s)")</strong>
                        </div>
                        <br/>
                        <div id="cart_items">
    

                            <div class="table-responsive cart_info">
                                <table class="table table-condensed">
                                    <thead>
                                        <tr class="cart_menu">
                                            <td class="a-center name">
                                                @T("ReturnRequests.Products.Name")
                                            </td>
                                            <td class="a-center price">
                                                @T("ReturnRequests.Products.Price")
                                            </td>
                                            <td class="a-center quantity">
                                                @T("ReturnRequests.Products.Quantity")
                                            </td>

                
                                        </tr>

                                    </thead>
                                    <tbody>
                                        @foreach (var item in Model.Items)
                                        {
                                            <tr>
                                                <td class="a-left name">
                                                    <a href="@Url.RouteUrl("Product", new {SeName = item.ProductSeName})">@item.ProductName</a>
                                                    @if (!String.IsNullOrEmpty(item.AttributeInfo))
                                                    {
                                                        <div class="attributes">
                                                            @Html.Raw(item.AttributeInfo)
                                                        </div>
                                                    }
                                                </td>
                                                <td class="a-left price">
                                                    @item.UnitPrice
                                                </td>
                                                <td class="a-left quantity">
                                                    <select name="quantity@(item.Id)" class="gray-dropdown">
                                                        @for (int i = 0; i <= item.Quantity; i++)
                                                        {
                                                            <option value="@(i)">@(i)</option>
                                                        }
                                                    </select>
                                                </td>
                                            </tr>
                                        }
                                    </tbody>
                                </table>
                            </div>

                        </div>


                                
                    </div>
                    <div class="row space20"></div>

                    <div class="fieldset">
                        <div class="title">
                            <strong>@T("ReturnRequests.WhyReturning")</strong>
                        </div>
                        <br/>

                        <div class="form-fields">
                            <div class="inputs">
                                @Html.LabelFor(model => model.ReturnReason, new {}, ":")
                                @Html.DropDownListFor(model => model.ReturnReason, Model.AvailableReturnReasons, new {@class = "gray-dropdown"})
                            </div>
                            <div class="inputs">
                                @Html.LabelFor(model => model.ReturnAction, new {}, ":")
                                @Html.DropDownListFor(model => model.ReturnAction, Model.AvailableReturnActions, new {@class = "gray-dropdown"})
                            </div>
                            <div class="inputs">
                                @Html.LabelFor(model => model.Comments, new {}, ":")
                                @Html.TextAreaFor(model => model.Comments, new {@class = "gray-textarea"})
                                @Html.ValidationMessageFor(model => model.Comments)
                            </div>
                        </div>
                    </div>
                    <div class="buttons pull-text-right">
                        <input type="submit" name="submit-return-request" class="btn btn-primary" value="@T("ReturnRequests.Submit")" />
                    </div>
                }
            }
        </div>
    </div>
</div>



